[FLINK-39370][flink-autoscaler] In-place scaling check only inspects K8s resource spec for adaptive scheduler, ignoring JM running configuration#1080
Closed
Dennis-Mircea wants to merge 1 commit into
Conversation
…K8s resource spec for adaptive scheduler, ignoring JM running configuration
Contributor
|
closing in favor of a different approach |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
NativeFlinkService.supportsInPlaceScaling()currently only inspects the KubernetesFlinkDeploymentresource spec to determine whether the adaptive scheduler is configured. If the adaptive scheduler is set through mechanisms outside the K8s spec (such as Flink's nativeflink-conf.yaml, environment variables, or command-line dynamic properties) the operator incorrectly concludes that in-place scaling is not supported and falls back to a full restart/redeploy cycle.This PR adds a fallback path: when the K8s resource spec does not indicate
jobmanager.scheduler: Adaptive, the operator queries the JobManager's actual running configuration via theJobManagerJobConfigurationHeadersREST endpoint. If the JM confirms the adaptive scheduler is active, in-place scaling proceeds normally.Brief change log
NativeFlinkService.javasupportsInPlaceScalingfromstaticto instance method (needed forgetClusterClientandoperatorConfigaccess)observeConfig.get(SCHEDULER)is notAdaptive:JobManagerJobConfigurationHeadersrequest to the running JMjobmanager.schedulerkeytrueonly if the value equalsAdaptiveSCHEDULERto a static import for readabilityConfigurationInfoEntry,JobManagerJobConfigurationHeaders,Optional,static SCHEDULERNativeFlinkServiceTest.javatestScalingservice setup to also overridegetClusterClient(returns aTestingClusterClientconfigured to returnDefaultscheduler from JM config, so existing "do not scale without adaptive scheduler" assertions remain valid)testScalingWithJmConfigFallback()test with 5 cases:ConfigurationInfo,ConfigurationInfoEntry,EmptyResponseBody,JobManagerJobConfigurationHeadersVerifying this change
This change is verified by the new
testScalingWithJmConfigFallbacktest which covers the complete matrix of fallback scenarios. Case 4 is the critical regression test - it verifies that the terminal/reconciling state check is never bypassed when the adaptive scheduler confirmation comes from the JM REST fallback path rather than the K8s spec. All 10 tests inNativeFlinkServiceTestpass.Does this pull request potentially affect one of the following parts:
CustomResourceDescriptors: noDocumentation